package org.homeworkteam.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.bouncycastle.asn1.its.IValue;
import org.homeworkteam.bean.Users;

@Mapper
public interface UserMapper extends BaseMapper<Users> {
    @Insert("INSERT INTO users(user_account, user_name, user_password, is_vip, user_money, user_phone, user_idcard, user_sex, status, create_time) " +
            "VALUES (#{users.userAccount}, #{users.userName}, #{users.userPassword}, 'false', 0, #{users.userPhone}, #{users.userIdcard}, #{users.userSex}, #{users.status}, NOW())")
    int addUser(@Param("users") Users users);

    @Select("select * from users where user_account = #{users.userAccount} and user_password = #{users.userPassword}")
    Users getUserInfo(@Param("users") Users users);

    @Select("select * from users where user_account = #{userAccount}")
    Users checkUser(@Param("userAccount") String userAccount);
}
